package org.zcl.sqlserver.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zcl.sqlserver.config.SyncCouponProperties;
import org.zcl.sqlserver.service.SyncConfigService;

/**
 * .
 *
 * @author zhuchenglin
 * @since 2024/7/19 14:58
 */
@RestController
@RequestMapping("/config/")
public class SyncConfigController {

    @Autowired
    SyncConfigService syncConfigService;

    @GetMapping("test/{size}")
    public void test(@PathVariable("size") Integer size) {
        syncConfigService.testSync(size);
    }

    @GetMapping("properties/{brand}")
    public SyncCouponProperties.CouponConfig properties(@PathVariable String brand) {
        return syncConfigService.getCouponConfigByBrand(brand);
    }
}
